import React from "react";
import { Layout } from "antd";
import ToolBarLeft from "@/layouts/components/Header/ToolBarLeft";
import ToolBarRight from "@/layouts/components/Header/ToolBarRight";
import LayoutMenu from "@/layouts/components//MyMenu";
import LayoutMain from "@/layouts/components/Main2";
import "./index.less";
import { useLocation } from "react-router-dom";

const { Header } = Layout;
const LayoutVertical: React.FC = () => {
  const location = useLocation();
  const routerName = () => {
    return location.pathname;
  };
  return (
    <section className="layout-vertical">
      <LayoutMenu />
      <Layout>
        {!routerName().includes("/home/index") ? (
          <Header>
            <ToolBarLeft />
            <ToolBarRight />
          </Header>
        ) : (
          ""
        )}
        <LayoutMain />
      </Layout>
    </section>
  );
};

export default LayoutVertical;
